;Assembler header file for ZLib
;written by DefMod (Dec 31 2005) on Sat Dec 31 14:11:43 2005
;Tom Hughes, tom@compton.nu, 22 Sep 2002

        [       :LNOT: :DEF: ZLib_Hdr
        GBLS    ZLib_Hdr

        [       :LNOT: :DEF: Get_Types
        GBLS    Get_Types
        ]
        [       :LNOT: :DEF: Types_Hdr
Get_Types                       SETS    "GET oslib/Types.Hdr"
        |
Get_Types                       SETS    ""
        ]
        $Get_Types

        [       :LNOT: :DEF: Get_FileSwitch
        GBLS    Get_FileSwitch
        ]
        [       :LNOT: :DEF: FileSwitch_Hdr
Get_FileSwitch                  SETS    "GET oslib/FileSwitch.Hdr"
        |
Get_FileSwitch                  SETS    ""
        ]
        $Get_FileSwitch

;Symbols for constants
ZLib_BinaryData                 *       &0
ZLib_ASCIIData                  *       &1
ZLib_UnknownData                *       &2
ZLib_NoFlush                    *       &0
ZLib_PartialFlush               *       &1
ZLib_SyncFlush                  *       &2
ZLib_FullFlush                  *       &3
ZLib_Finish                     *       &4
ZLib_NoCompression              *       &0
ZLib_BestSpeed                  *       &1
ZLib_BestCompression            *       &9
ZLib_DefaultCompression         *       &FFFFFFFF
ZLib_DefaultStrategy            *       &0
ZLib_Filtered                   *       &1
ZLib_HuffmanOnly                *       &2
ZLib_Deflated                   *       &8
ZLib_OK                         *       &0
ZLib_StreamEnd                  *       &1
ZLib_NeedDict                   *       &2
ZLib_Errno                      *       &FFFFFFFF
ZLib_StreamError                *       &FFFFFFFE
ZLib_DataError                  *       &FFFFFFFD
ZLib_MemError                   *       &FFFFFFFC
ZLib_BufError                   *       &FFFFFFFB
ZLib_VersionError               *       &FFFFFFFA
ZLib_SeekAbsolute               *       &0
ZLib_SeekRelative               *       &1

;Symbols for structure offsets and sizes
                                ^       0
                                #       Int
ZLib_DataType                   *       @

                                ^       0
                                #       Int
ZLib_FlushType                  *       @

                                ^       0
                                #       Int
ZLib_CompressionLevel           *       @

                                ^       0
                                #       Int
ZLib_CompressionStrategy        *       @

                                ^       0
                                #       Int
ZLib_CompressionMethod          *       @

                                ^       0
                                #       Int
ZLib_MemoryLevel                *       @

                                ^       0
                                #       Int
ZLib_WindowBits                 *       @

                                ^       0
                                #       Int
ZLib_ReturnCode                 *       @

                                ^       0
                                #       Int
ZLib_SeekType                   *       @

                                ^       0
ZLib_StreamControlBlock_next_in #       Int
ZLib_StreamControlBlock_avail_in #       Int
ZLib_StreamControlBlock_total_in #       Int
ZLib_StreamControlBlock_next_out #       Int
ZLib_StreamControlBlock_avail_out #       Int
ZLib_StreamControlBlock_total_out #       Int
ZLib_StreamControlBlock_msg     #       Ptr
ZLib_StreamControlBlock_state   #       Int
ZLib_StreamControlBlock_zalloc  #       Ptr
ZLib_StreamControlBlock_zfree   #       Ptr
ZLib_StreamControlBlock_opaque  #       Ptr
ZLib_StreamControlBlock_data_type #       ZLib_DataType
ZLib_StreamControlBlock_adler   #       Int
ZLib_StreamControlBlock_reserved #       Int
ZLib_StreamControlBlock         *       @

ZLib_GZipHandle                 *       4 ;abstract type

;Symbols for SWI's and SWI reason codes
XZLib_Compress                  *       &73AC0
ZLib_Compress                   *       &53AC0
   ;Entry
   ;  R0 = flags (Bits)
   ;  R1 = workspace (pointer to data)
   ;  R2 -> input (data)
   ;  R3 = input_size (Int)
   ;  R4 = output (pointer to data)
   ;  R5 = output_size (Int)
   ;Exit
   ;  R0 = status (Bits)
   ;  R2 -> unused_input (data)
   ;  R3 = unused_input_size (Int)
   ;  R4 = unused_output (pointer to data)
   ;  R5 = unused_output_size (Int)

XZLib_Decompress                *       &73AC1
ZLib_Decompress                 *       &53AC1
   ;Entry
   ;  R0 = flags (Bits)
   ;  R1 = workspace (pointer to data)
   ;  R2 -> input (data)
   ;  R3 = input_size (Int)
   ;  R4 = output (pointer to data)
   ;  R5 = output_size (Int)
   ;Exit
   ;  R0 = status (Bits)
   ;  R2 -> unused_input (data)
   ;  R3 = unused_input_size (Int)
   ;  R4 = unused_output (pointer to data)
   ;  R5 = unused_output_size (Int)

XZLib_CRC32                     *       &73AC2
ZLib_CRC32                      *       &53AC2
   ;Entry
   ;  R0 = continuation_value (Int)
   ;  R1 -> data_start (data)
   ;  R2 -> data_end (data)
   ;Exit
   ;  R0 = crc32 (Int)

XZLib_Adler32                   *       &73AC3
ZLib_Adler32                    *       &53AC3
   ;Entry
   ;  R0 = continuation_value (Int)
   ;  R1 -> data_start (data)
   ;  R2 -> data_end (data)
   ;Exit
   ;  R0 = crc32 (Int)

XZLib_Version                   *       &73AC4
ZLib_Version                    *       &53AC4
   ;Exit
   ;  R0 -> version (Char)

XZLib_ZCompress                 *       &73AC5
ZLib_ZCompress                  *       &53AC5
   ;Entry
   ;  R0 = output (pointer to data)
   ;  R1 = output_size (Int)
   ;  R2 -> input (data)
   ;  R3 = input_size (Int)
   ;Exit
   ;  R0 = return_code (ZLib_ReturnCode)
   ;  R1 = output_used (Int)

XZLib_ZCompress2                *       &73AC6
ZLib_ZCompress2                 *       &53AC6
   ;Entry
   ;  R0 = output (pointer to data)
   ;  R1 = output_size (Int)
   ;  R2 -> input (data)
   ;  R3 = input_size (Int)
   ;  R4 = compression_level (ZLib_CompressionLevel)
   ;Exit
   ;  R0 = return_code (ZLib_ReturnCode)
   ;  R1 = output_used (Int)

XZLib_ZUncompress               *       &73AC7
ZLib_ZUncompress                *       &53AC7
   ;Entry
   ;  R0 = output (pointer to data)
   ;  R1 = output_size (Int)
   ;  R2 -> input (data)
   ;  R3 = input_size (Int)
   ;Exit
   ;  R0 = return_code (ZLib_ReturnCode)
   ;  R1 = output_used (Int)

XZLib_DeflateInit               *       &73AC8
ZLib_DeflateInit                *       &53AC8
   ;Entry
   ;  R0 = scb (pointer to ZLib_StreamControlBlock)
   ;  R1 = compression_level (ZLib_CompressionLevel)
   ;  R2 -> version_expected (Char)
   ;  R3 = scb_size (Int)
   ;Exit
   ;  R0 = return_code (ZLib_ReturnCode)

XZLib_InflateInit               *       &73AC9
ZLib_InflateInit                *       &53AC9
   ;Entry
   ;  R0 = scb (pointer to ZLib_StreamControlBlock)
   ;  R1 -> version_expected (Char)
   ;  R2 = scb_size (Int)
   ;Exit
   ;  R0 = return_code (ZLib_ReturnCode)

XZLib_DeflateInit2              *       &73ACA
ZLib_DeflateInit2               *       &53ACA
   ;Entry
   ;  R0 = scb (pointer to ZLib_StreamControlBlock)
   ;  R1 = compression_level (ZLib_CompressionLevel)
   ;  R2 = compression_method (ZLib_CompressionMethod)
   ;  R3 = window_bits (ZLib_WindowBits)
   ;  R4 = memory_level (ZLib_MemoryLevel)
   ;  R5 = compression_strategy (ZLib_CompressionStrategy)
   ;  R6 -> version_expected (Char)
   ;  R7 = scb_size (Int)
   ;Exit
   ;  R0 = return_code (ZLib_ReturnCode)

XZLib_InflateInit2              *       &73ACB
ZLib_InflateInit2               *       &53ACB
   ;Entry
   ;  R0 = scb (pointer to ZLib_StreamControlBlock)
   ;  R1 = window_bits (ZLib_WindowBits)
   ;  R2 -> version_expected (Char)
   ;  R3 = scb_size (Int)
   ;Exit
   ;  R0 = return_code (ZLib_ReturnCode)

XZLib_Deflate                   *       &73ACC
ZLib_Deflate                    *       &53ACC
   ;Entry
   ;  R0 = scb (pointer to ZLib_StreamControlBlock)
   ;  R1 = flush_type (ZLib_FlushType)
   ;Exit
   ;  R0 = return_code (ZLib_ReturnCode)

XZLib_DeflateEnd                *       &73ACD
ZLib_DeflateEnd                 *       &53ACD
   ;Entry
   ;  R0 = scb (pointer to ZLib_StreamControlBlock)
   ;Exit
   ;  R0 = return_code (ZLib_ReturnCode)

XZLib_Inflate                   *       &73ACE
ZLib_Inflate                    *       &53ACE
   ;Entry
   ;  R0 = scb (pointer to ZLib_StreamControlBlock)
   ;  R1 = flush_type (ZLib_FlushType)
   ;Exit
   ;  R0 = return_code (ZLib_ReturnCode)

XZLib_InflateEnd                *       &73ACF
ZLib_InflateEnd                 *       &53ACF
   ;Entry
   ;  R0 = scb (pointer to ZLib_StreamControlBlock)
   ;Exit
   ;  R0 = return_code (ZLib_ReturnCode)

XZLib_DeflateSetDictionary      *       &73AD0
ZLib_DeflateSetDictionary       *       &53AD0
   ;Entry
   ;  R0 = scb (pointer to ZLib_StreamControlBlock)
   ;  R1 -> dictionary (data)
   ;  R2 = dictionary_size (Int)
   ;Exit
   ;  R0 = return_code (ZLib_ReturnCode)

XZLib_DeflateCopy               *       &73AD1
ZLib_DeflateCopy                *       &53AD1
   ;Entry
   ;  R0 = destination (pointer to ZLib_StreamControlBlock)
   ;  R1 -> source (ZLib_StreamControlBlock)
   ;Exit
   ;  R0 = return_code (ZLib_ReturnCode)

XZLib_DeflateReset              *       &73AD2
ZLib_DeflateReset               *       &53AD2
   ;Entry
   ;  R0 = scb (pointer to ZLib_StreamControlBlock)
   ;Exit
   ;  R0 = return_code (ZLib_ReturnCode)

XZLib_DeflateParams             *       &73AD3
ZLib_DeflateParams              *       &53AD3
   ;Entry
   ;  R0 = scb (pointer to ZLib_StreamControlBlock)
   ;  R1 = compression_level (ZLib_CompressionLevel)
   ;  R2 = compression_strategy (ZLib_CompressionStrategy)
   ;Exit
   ;  R0 = return_code (ZLib_ReturnCode)

XZLib_InflateSetDictionary      *       &73AD4
ZLib_InflateSetDictionary       *       &53AD4
   ;Entry
   ;  R0 = scb (pointer to ZLib_StreamControlBlock)
   ;  R1 -> dictionary (data)
   ;  R2 = dictionary_size (Int)
   ;Exit
   ;  R0 = return_code (ZLib_ReturnCode)

XZLib_InflateSync               *       &73AD5
ZLib_InflateSync                *       &53AD5
   ;Entry
   ;  R0 = scb (pointer to ZLib_StreamControlBlock)
   ;Exit
   ;  R0 = return_code (ZLib_ReturnCode)

XZLib_InflateReset              *       &73AD6
ZLib_InflateReset               *       &53AD6
   ;Entry
   ;  R0 = scb (pointer to ZLib_StreamControlBlock)
   ;Exit
   ;  R0 = return_code (ZLib_ReturnCode)

XZLib_GZOpen                    *       &73AD7
ZLib_GZOpen                     *       &53AD7
   ;Entry
   ;  R0 -> filename (Char)
   ;  R1 -> mode (Char)
   ;  R2 = load_address_in (Bits)
   ;  R3 = exec_address_in (Bits)
   ;  R4 = size_in (Int)
   ;  R5 = attr_in (FileSwitch_Attr)
   ;Exit
   ;  R0 = handle (ZLib_GZipHandle)
   ;  R2 = load_address_out (Bits)
   ;  R3 = exec_address_out (Bits)
   ;  R4 = size_out (Int)
   ;  R5 = attr_out (FileSwitch_Attr)

XZLib_GZRead                    *       &73AD8
ZLib_GZRead                     *       &53AD8
   ;Entry
   ;  R0 = handle (ZLib_GZipHandle)
   ;  R1 = data (pointer to Byte)
   ;  R2 = size (Int)
   ;Exit
   ;  R0 = read (Int)

XZLib_GZWrite                   *       &73AD9
ZLib_GZWrite                    *       &53AD9
   ;Entry
   ;  R0 = handle (ZLib_GZipHandle)
   ;  R1 -> data (Byte)
   ;  R2 = size (Int)
   ;Exit
   ;  R0 = written (Int)

XZLib_GZFlush                   *       &73ADA
ZLib_GZFlush                    *       &53ADA
   ;Entry
   ;  R0 = handle (ZLib_GZipHandle)
   ;  R1 = flush_type (ZLib_FlushType)
   ;Exit
   ;  R0 = return_code (ZLib_ReturnCode)

XZLib_GZClose                   *       &73ADB
ZLib_GZClose                    *       &53ADB
   ;Entry
   ;  R0 = handle (ZLib_GZipHandle)
   ;Exit
   ;  R0 = return_code (ZLib_ReturnCode)

XZLib_GZError                   *       &73ADC
ZLib_GZError                    *       &53ADC
   ;Entry
   ;  R0 = handle (ZLib_GZipHandle)
   ;Exit
   ;  R0 -> message (Char)
   ;  R1 = return_code (ZLib_ReturnCode)

XZLib_GZSeek                    *       &73ADD
ZLib_GZSeek                     *       &53ADD
   ;Entry
   ;  R0 = handle (ZLib_GZipHandle)
   ;  R1 = position (Int)
   ;  R2 = seek_type (ZLib_SeekType)
   ;Exit
   ;  R0 = new_position (Int)

XZLib_GZTell                    *       &73ADE
ZLib_GZTell                     *       &53ADE
   ;Entry
   ;  R0 = handle (ZLib_GZipHandle)
   ;Exit
   ;  R0 = position (Int)

XZLib_GZEOF                     *       &73ADF
ZLib_GZEOF                      *       &53ADF
   ;Entry
   ;  R0 = handle (ZLib_GZipHandle)
   ;Exit
   ;  R0 = eof (Bool)

XZLib_TaskAssociate             *       &73ADF
ZLib_TaskAssociate              *       &53ADF
   ;Entry
   ;  R0 = scb (pointer to ZLib_StreamControlBlock)

        ]
        END
